package org.example.controller;
/*
 * fzl
 * */

import org.example.domain.model.Result;
import org.example.service.OssService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


@RestController
@RequestMapping("/upload")
@CrossOrigin("*")
public class UpLoadController {
    @GetMapping("/test")
    public String test() {
        return "success";
    }

    @Resource
    private OssService ossService;

    @PostMapping
    public Result upload(@RequestParam("file") MultipartFile uploadFile) throws Exception {
        return ossService.upload(uploadFile);
    }
/*    public Map upload() throws Exception {
        String filePath = "E:/test1.txt";
        Map result = this.ossService.SimpleUpload(filePath);
        return result;
    }*/

}
